<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePriceSpecificationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('price_specifications', function (Blueprint $table) {
            $table->unsignedBigInteger('id')->primary();
            $table->string('name')->nullable()->default('')->comment('档次名称');
            $table->unsignedBigInteger('user_id')->default(0)->comment('创建用户ID')->index('user');
            $table->string('province',12)->nullable()->default('')->comment('省')->index('province');
            $table->string('city',12)->nullable()->default('')->comment('市')->index('city');
            $table->string('area',12)->nullable()->default('')->comment('区')->index('area');
            $table->enum('cate',['NORMAL','PRIVATE'])->nullable()->default('NORMAL')->comment('价格类型NORMAL全局PRIVATE局部' );
            $table->enum('style',['TEA_HOUSE','INTERNET_CAFE'])->nullable()->default('INTERNET_CAFE')->comment('款式TEA_HOUSE茶楼,INTERNET_CAFE网吧' );
            $table->integer('duration')->nullable()->default(0)->comment('时长 按分钟计');
            $table->integer('price')->nullable()->default(0)->comment('价格 按分计');
            $table->timestamps();
            $table->softDeletes();
            $table->charset = 'utf8mb4';
            $table->collation = 'utf8mb4_unicode_ci';
            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('price_specifications');
    }
}
